#pragma once

#include "RBTree.h"

template <class K>
class set
{
private:

	class SetKey
	{
	public:
		const K& operator()(const K& v)
		{
			return v;
		}
	};
public:
	typedef typename RBTree<K, const K, SetKey>::iterator iterator;
	typedef typename RBTree<K, const K, SetKey>::const_iterator const_iterator;
	const_iterator begin() const
	{
		return _t.begin();
	}

	const_iterator end() const
	{
		return _t.end();
	}

	iterator begin()
	{
		return _t.begin();
	}

	iterator end()
	{
		return _t.end();
	}

	pair<iterator, bool> insert(const K& k)
	{
		return _t.insert(k);
	}

	size_t size()
	{
		return _t.size();
	}
	iterator find(const K& k)
	{
		return _t.find(k);
	}

	bool isok()
	{
		return _t.IsRBTree();
	}

private:
	RBTree<K,const K, SetKey> _t;

};